package com.example.a80205050.myapplication.Dao;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by 80205050 on 2017/10/30.
 */
public class DBOpenHelper extends SQLiteOpenHelper {
    private static final int VERSION=1;//定义数据库的版本
    private static final String DBNAME="account.db";//定义数据库的名字
    //默认的构造器
    public DBOpenHelper(Context context) {
        super(context, DBNAME, null, VERSION);
    }
    //创建数据库
    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        //创建支出信息表
        sqLiteDatabase.execSQL("create table tb_outaccount (_id integer primary key ,money decimal," +
                "time varchar(10),type varchar(10),address varchar(10),mark varchar(200))");
        //创建收入信息表
        sqLiteDatabase.execSQL("create table tb_inaccount (_id integer primary key ,money decimal," +
                "time varchar(10),type varchar(10),handler varchar(10),address varchar(10),mark varchar(200))");
       //创建密码表
        sqLiteDatabase.execSQL("create table tb_pwd (password varchar(20))");
        //创建便签信息表
        sqLiteDatabase.execSQL("create table tb_flag(_id integer primary key ,flag varchar(200))");
    }
    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }
}
